package cn.com.wangluotongxin.admin.model.constants;

public enum MerchantsInfoStatus {

    // 状态:0.草稿 1.申请中 2.受理中 3.申请完成 4.取消申请 5.驳回申请
    DRAFT(0, "草稿"),
    APPLY(1, "申请中"),
    HANDLE(2, "受理中"),
    FINISH(3, "申请完成"),
    CANCEL(4, "取消申请"),
    REJECT(5, "驳回申请");

    private Integer code;

    public Integer getCode() {
        return code;
    }

    private String name;

    public String getName() {
        return name;
    }

    public static MerchantsInfoStatus getByCode(Integer code){
        if(code == null){
            return null;
        }else {
            MerchantsInfoStatus[] merchantsInfoStatuses = values();
            for(MerchantsInfoStatus statuses : merchantsInfoStatuses){
                if(statuses.getCode().equals(code)){
                    return statuses;
                }
            }
        }
        return null;
    }

    MerchantsInfoStatus(Integer code, String name){
        this.code = code;
        this.name = name;
    }
}
